#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

struct TreeNode
{
    int val;
    TreeNode* left;
    TreeNode* right;
};

typedef struct TreeNode TreeNode;

void SwapTree(TreeNode* root)
{
    if (root == NULL)
    {
        return;
    }
    TreeNode* temp = root->left;
    root->left = root->right;
    root->right = temp;
    SwapTree(root->left);
    SwapTree(root->right);
}

struct TreeNode* Mirror(struct TreeNode* pRoot)
{
    SwapTree(pRoot);
    return pRoot;
}